﻿@model Webdiyer.WebControls.Mvc.IPagedList<HouseAgencySite.Models.Users>
@using HouseAgencySite.Utils;
@{
    ViewBag.Title = "人员列表";
    Layout = "~/Areas/Admin/Views/Shared/_ListLayout.cshtml";
}

@section query{

    <table class="table table-bordered">

        <tr>
            <td>用户名</td>
            <td>
                <input type="text" name="LogonName" id="txtLogonName"  value="@Request["LogonName"]"/></td>
            <td>姓名</td>
            <td>
                <input type="text" name="UserName" id="txtUserName" value="@Request["UserName"]"/></td>

        </tr>
        <tr>
            <td>电话</td>
            <td>
                <input type="text" name="Telephone" id="txtTelephone" value="@Request["Telephone"]" /></td>
            <td>邮箱</td>
            <td>
                <input type="text" name="Email" id="txtEmail" value="@Request["Email"]" /></td>
        </tr>
        <tr>
            <td colspan="4" class="text-center">
                <input type="submit" value="查询" id="btnSearch" class="btn btn-primary" />
                <input type="reset" value="重置" id="btnReset" class="btn btn-primary" />
            </td>

        </tr>
    </table>

}
@section toolbar{
    @*@Html.ActionLink("新增", "Create", null, new { @class = "btn btn-primary" })*@
    <a href="javascript:void(0);" onclick="Edit('@Url.Action("Create", "Users", null)',500,600,null)" class="btn btn-primary">新增</a>
}
@section list{
    <table class="table table-bordered">

        <tr class="btn-success">
            <th>序号</th>
            <th>用户名
            </th>
            <th>姓名
            </th>
            <th>电话
            </th>
            <th>邮箱
            </th>
            <th>用户类型
            </th>
            <th>创建时间
            </th>

            <th>创建人
            </th>
            <th>操作</th>
        </tr>
        @{
            int i = 0;
        }
        @foreach (var item in Model)
        {
        
            <tr class="@(i % 2 == 0 ? "success" : "warning")">
                <td>@(i + 1+(Model.CurrentPageIndex-1)*10)</td>
                <td>
                    @Html.DisplayFor(modelItem => item.LogonName)
                </td>

                <td>
                    @Html.DisplayFor(modelItem => item.UserName)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Telephone)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Email)
                </td>


                <td>
                    @if (item.UserType == 0)
                    {
                        @:管理员
                    }
                    else
                    {
                        @:业务员
                    }
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.CreateTime)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.CreateUserName)
                </td>
                <td>
                    <a href="javascript:void(0);" onclick="Edit('@Url.Action("Edit", "Users", new { id = item.Guid })',500,600,null)" class="btn btn-primary btn-xs">编辑</a> |
                    <a href="javascript:void(0);" onclick="openModalPage('@Url.Action("Details", "Users", new { id = item.Guid })',0,600,null)" class="btn btn-primary btn-xs">查看</a>|
                    <a href="javascript:void(0);" onclick="Delete('@Url.Action("Delete", "Users", new { id = item.Guid })')" class="btn btn-primary btn-xs">删除</a>
                </td>
            </tr>
            i++;
        }

    </table>
    <div class="text-center">@Html.HtmlPager(Model)</div>
}
